package com.example.lightenergypolymerize.util;

import lombok.Data;

import java.io.Serial;
import java.io.Serializable;


@Data
public class ResponseEntity implements Serializable {
    @Serial
    private static final long serialVersionUID = 4581593792717613764L;
    private int code;
    private String msg;
    private Object data;

    public static ResponseEntity succ(Object data) {
       ResponseEntity responseEntity = new ResponseEntity();
       responseEntity.setCode(200);
       responseEntity.setMsg("成功");
       responseEntity.setData(data);
       return responseEntity;
    }

    public static ResponseEntity fail(String msg) {
       ResponseEntity responseEntity = new ResponseEntity();
       responseEntity.setCode(500);
       responseEntity.setMsg(msg);
       responseEntity.setData(null);
       return responseEntity;
    }


}
